package com.yuan.model_community.repository;

import com.yuan.model_community.domain.CommunityBuilding;
import com.yuan.model_community.domain.CommunityHouse;
import com.yuan.model_community.domain.CommunityUnit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface CommunityUnitDao extends JpaRepository<CommunityUnit, Integer>, JpaSpecificationExecutor<CommunityUnit> {

    @Query(value = "select cb.buildingName from CommunityBuilding cb where cb.buildingId = :buildingId")
    String findCommunityBuildingById(Integer buildingId);

}
